package org.hu.flexeasy.ui.datagrid
{
	import flash.events.Event;
	
	import spark.components.BorderContainer;
	import spark.layouts.supportClasses.LayoutBase;

	[Event(name="changeRowHeightEvent",type="flash.events.Event")]
	
	/**
	 * <p>
	 * 		<b>HUBO 2012-1-17  /  hubo.0508ⓐgmail.com</br>org.hu.flexeasy.ui.datagrid.CellsRenderer.as</b>
	 * </p>
	 */
	public class CellsRenderer extends BorderContainer
	{

		public static const CHANGE_ROW_HEIGHT:String = "changeRowHeightEvent";
		
		public function CellsRenderer(backgroundAlpha:Object = null, borderVisible:Object = null,layout:LayoutBase = null)
		{
			super();			
		
			this.minHeight = 18;
			
			if(layout != null)
			{
				this.layout = layout;
			}
			
			if(backgroundAlpha != null)
			{
				this.setStyle("backgroundAlpha",backgroundAlpha);
			}
			
			if(borderVisible != null)
			{
				this.setStyle("borderVisible",borderVisible);
			}
		}
		
		override protected function updateDisplayList(uw:Number, uh:Number):void
		{
			uh -= 1;
			super.updateDisplayList(uw,uh);
			
			trace(uh);
			
			this.dispatchEvent(new Event(CHANGE_ROW_HEIGHT));
		}
		
		override protected function measure():void
		{
			super.measure();
			//measuredHeight = 22;
			//this.measuredMinHeight = 22;
		}
		
	}
}